package graphics.datastructures;

import java.util.Comparator;

public class Sorters {
	private static final int x =0;
	private static final int y =1;
	private static final int z =2;
	public static final Comparator<Model> xminComparator = new Comparator<Model>() {

		@Override
		public int compare(Model o1, Model o2) {
			float[] lbn1 = o1.getBB()[0];
			float[] lbn2 = o1.getBB()[0];
			if(lbn1[x]<lbn2[x])
				return -1;
			if(lbn1[x]>lbn2[x])
				return 1;
			return 0;
		}
	};
	public static final Comparator<Model> yminComparator = new Comparator<Model>() {

		@Override
		public int compare(Model o1, Model o2) {
			float[] lbn1 = o1.getBB()[0];
			float[] lbn2 = o1.getBB()[0];
			if(lbn1[y]<lbn2[y])
				return -1;
			if(lbn1[y]>lbn2[y])
				return 1;
			return 0;
		}
	};	public static final Comparator<Model> zminComparator = new Comparator<Model>() {

		@Override
		public int compare(Model o1, Model o2) {
			float[] lbn1 = o1.getBB()[0];
			float[] lbn2 = o1.getBB()[0];
			if(lbn1[z]<lbn2[z])
				return -1;
			if(lbn1[z]>lbn2[z])
				return 1;
			return 0;
		}
	};
}
